package com.lt.java.test;

public class test {
	
	public static void main(String args[]){
		
	String tempstr = "abcdefghijklmnopqrstuvwxyz";
    int times = 50000;
    long lstart1 = System.currentTimeMillis();
    String str = "";
    for (int i = 0; i < times; i++) {
        str += tempstr;
    }
    long lend1 = System.currentTimeMillis();
    long time = (lend1 - lstart1);
    System.out.println(time);
		
//		String tempstr = "abcdefghijklmnopqrstuvwxyz";
//        int times = 5000;
        long lstart2 = System.currentTimeMillis();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < times; i++) {
            sb.append(tempstr);
        }
        long lend2 = System.currentTimeMillis();
        long time2 = (lend2 - lstart2);
        System.out.println(time2 + "\n" + str.equals(sb.toString()));
    }
}
